#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read() {
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 255;
const ll inf = 1e18 + 10;

int nodenum,n,m,T,K,c[N];
struct edge { int u,v,w; } e[N << 1];
struct spe { int t,x,y; } s[N];
bool operator < (spe a,spe b) { return a.t < b.t; }

struct mat {
	ll arr[N][N];
	ll * operator [] (int x) { return arr[x]; }
	const ll * operator [] (int x) const { return arr[x]; }
	mat () { memset(arr,0xcf,sizeof arr); }
	friend mat operator * (mat a,mat b) {
		mat c;
		for(int i = 0;i < nodenum;i++)
			for(int j = 0;j < nodenum;j++)
				if(a[i][j] >= 0)
					for(int k = 0;k < nodenum;k++)
						c[i][k] = max(c[i][k],a[i][j] + b[j][k]);
		return c;
	}
}val,pw[50];

int index(int x,int y) { return (x - 1) * 5 + y; }

mat gen() {
	mat res;
	for(int i = 1;i <= m;i++) {
		int u = e[i].u,v = e[i].v,w = e[i].w;
		res[index(u,w - 1)][index(v,0)] = max(res[index(u,w - 1)][index(v,0)],(ll) c[v]);
	}
	for(int i = 1;i <= n;i++) for(int j = 0;j < 4;j++) res[index(i,j)][index(i,j + 1)] = 0;
	return res;
}

void qpow(int t) { for(int i = 0;t;t >>= 1,i++) if(t & 1) val = val * pw[i]; }

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in,T = in,K = in; for(int i = 1;i <= n;i++) c[i] = in;
	for(int i = 1;i <= m;i++) e[i].u = in,e[i].v = in,e[i].w = in;
	for(int i = 1;i <= K;i++) s[i].t = in,s[i].x = in,s[i].y = in;
	sort(s + 1,s + K + 1);
	nodenum = n * 5;
	pw[0] = gen(); //for(int i = 0;i < nodenum;i++,cerr << endl) for(int j = 0;j < nodenum;j++) cerr << max(pw[0][i][j],-1ll) << " " ;
	for(int i = 1;i < 30;i++) pw[i] = pw[i - 1] * pw[i - 1];
	int lst = 0; val[index(1,0)][0] = c[1];
	for(int i = 1;i <= K;i++) {
		if(s[i].t - lst > 1) qpow(s[i].t - lst - 1);
		c[s[i].x] += s[i].y; val = val * gen();
		c[s[i].x] -= s[i].y; lst = s[i].t;
	}
	if(T - lst) qpow(T - lst);
	ll ans = val[index(1,0)][0];
	if(ans < 0) puts("-1");
	else printf("%lld\n",ans);
	return 0;
}
